#include "common.h"
VOID AffairManager()
{
   MESSAGE message;
   SIGNAL  signal;


   signal.sourcepid=SERVERMANAGER;
   signal.signal=SIGNAL_ANY;
   signal.dt=0;
   WaitSignal(&signal);
/*---------------To activate the process affair  process.----------------*/
   InitKernelPCB(PROCESSAFFAIR,(PVOID)GetPhysicalAddress(ProcessAffair),(0x200000-0x4000*PROCESSAFFAIR),10,"ProcessAffair",NULL,NULL);
   ActivateProcess(&kernelprocess[PROCESSAFFAIR]);
   message.destination=PROCESSAFFAIR;
   message.type=PROCESSAFFAIR_WHOIAM;
   SendMessage(&message);

   
/*---------------To activate the interface manager process.-------------*/
   signal.dt=INTERFACEMANAGER;
   signal.signal=SIGNAL_ANY;
   signal.returnvalue=0;
   NotifyWaited(&signal);


   while(1)
   {
    if(ReceiveMessage(&message)!=ARTIST_ERROR_OK)continue;
     switch(message.type)
     {
       case AFFAIRMANAGER_WHOIAM:
       {
        //  Print("\n");

          Print("\nAffairManager begin...\n");
          
          break;
       }
       case AFFAIRMANAGER_PROCESSAFFAIR:
       {
	   	  InitKernelPCB(PROCESSAFFAIR,(PVOID)GetPhysicalAddress(ProcessAffair),(0x200000-0x4000*PROCESSAFFAIR),10,"ProcessAffair",NULL,NULL);
          ActivateProcess(&kernelprocess[PROCESSAFFAIR]);
          message.destination=PROCESSAFFAIR;
          message.type=PROCESSAFFAIR_WHOIAM;
          SendMessage(&message);
          break;
       }
     }
   }
}

